package lintcode.NO3368;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @Author: zeng
 * @Date: 2025/05/14/17:17
 * @Description:
 **/
public class Solution {

    public void sortByLength(String[] strArr) {
        if (strArr == null || strArr.length == 0) {
            return;
        }
        Arrays.sort(strArr, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.length() - o2.length();
            }
        });
        for (String str:strArr
             ) {
            System.out.println(str);
        }
    }
}
